package com.punch.common.exception;


/**
 * 系统模块自定义异常枚举
 *
 * @author cyd
 * @since 2019-12-05
 */
public enum CommonExceptionEnum implements ExceptionEnum {


    PARAMETER_LESS(10001, "缺少参数"),

    SAVE_ERROR(10002, "新增错误"),

    UPDATE_ERROR(10003, "更新错误"),

    DELETE_ERROR(10004, "删除错误"),

    SERVER_ERROR(10005, "服务器异常");

    private Integer code;
    private String msg;

    /**
     * 构造方法
     *
     * @param code    异常编码
     * @param message 异常信息
     * @author cyd
     * @since 2019-12-05
     */
    CommonExceptionEnum(int code, String message) {
        this.code = code;
        this.msg = message;
    }

    /**
     * 获取异常编码
     */
    @Override
    public Integer getCode() {
        return code;
    }

    /**
     * 获取异常信息
     */
    @Override
    public String getMsg() {
        return msg;
    }


}
